/* Our mapping of the current region (batch) */
char *region_base;
- xc_mmu_t *mmu = NULL;
+ struct xc_mmu *mmu = NULL;
/* used by debug verify code */
unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
for ( pfn = 0; pfn < p2m_size; pfn++ )
p2m[pfn] = INVALID_P2M_ENTRY;
- if(!(mmu = xc_init_mmu_updates(xc_handle, dom))) {
+ mmu = xc_alloc_mmu_updates(xc_handle, dom);
+ if ( mmu == NULL )
+ {
ERROR("Could not initialise for MMU updates");
goto out;
}
* Ensure we flush all machphys updates before potential PAE-specific
* reallocations below.
*/
- if (!hvm && xc_finish_mmu_updates(xc_handle, mmu)) {
- ERROR("Error doing finish_mmu_updates()");
+ if (!hvm && xc_flush_mmu_updates(xc_handle, mmu)) {
+ ERROR("Error doing flush_mmu_updates()");
goto out;
}
}
}
- if (xc_finish_mmu_updates(xc_handle, mmu)) {
- ERROR("Error doing finish_mmu_updates()");
+ if (xc_flush_mmu_updates(xc_handle, mmu)) {
+ ERROR("Error doing xc_flush_mmu_updates()");
goto out;
}
}
return ret;
}
-static int flush_mmu_updates(int xc_handle, xc_mmu_t *mmu)
+static int flush_mmu_updates(int xc_handle, struct xc_mmu *mmu)
{
int err = 0;
DECLARE_HYPERCALL;
return err;
}
-xc_mmu_t *xc_init_mmu_updates(int xc_handle, domid_t dom)
+struct xc_mmu *xc_alloc_mmu_updates(int xc_handle, domid_t dom)
{
- xc_mmu_t *mmu = malloc(sizeof(xc_mmu_t));
+ struct xc_mmu *mmu = malloc(sizeof(*mmu));
if ( mmu == NULL )
return mmu;
mmu->idx = 0;
return mmu;
}
-int xc_add_mmu_update(int xc_handle, xc_mmu_t *mmu,
+int xc_add_mmu_update(int xc_handle, struct xc_mmu *mmu,
unsigned long long ptr, unsigned long long val)
{
mmu->updates[mmu->idx].ptr = ptr;
return 0;
}
-int xc_finish_mmu_updates(int xc_handle, xc_mmu_t *mmu)
+int xc_flush_mmu_updates(int xc_handle, struct xc_mmu *mmu)
{
return flush_mmu_updates(xc_handle, mmu);
}
/* Optionally flush file to disk and discard page cache */
void discard_file_cache(int fd, int flush);
+#define MAX_MMU_UPDATES 1024
+struct xc_mmu {
+ mmu_update_t updates[MAX_MMU_UPDATES];
+ int idx;
+ domid_t subject;
+};
+/* Structure returned by xc_alloc_mmu_updates must be free()'ed by caller. */
+struct xc_mmu *xc_alloc_mmu_updates(int xc_handle, domid_t dom);
+int xc_add_mmu_update(int xc_handle, struct xc_mmu *mmu,
+ unsigned long long ptr, unsigned long long val);
+int xc_flush_mmu_updates(int xc_handle, struct xc_mmu *mmu);
+
#endif /* __XC_PRIVATE_H__ */
int xc_version(int xc_handle, int cmd, void *arg);
-/*
- * MMU updates.
- */
-#define MAX_MMU_UPDATES 1024
-struct xc_mmu {
- mmu_update_t updates[MAX_MMU_UPDATES];
- int idx;
- domid_t subject;
-};
-typedef struct xc_mmu xc_mmu_t;
-xc_mmu_t *xc_init_mmu_updates(int xc_handle, domid_t dom);
-int xc_add_mmu_update(int xc_handle, xc_mmu_t *mmu,
- unsigned long long ptr, unsigned long long val);
-int xc_finish_mmu_updates(int xc_handle, xc_mmu_t *mmu);
-
int xc_acm_op(int xc_handle, int cmd, void *arg, unsigned long arg_size);
/*